import compressPlugin from "vite-plugin-compression";

export function configCompressPlugin(){
  let deleteOriginFile = true,compress = "gzip,none"
  const compressList = compress.split(",");
  const plugins = [];
  if (compressList.includes("gzip")) {
    plugins.push(
      compressPlugin({
        ext: ".gz",
        deleteOriginFile,
        filter: /\.(js|mjs|json|css)$/i
      })
    );
  }
  return plugins;
}
